﻿<%@ Page Language="C#" MasterPageFile="~/Frame.master" AutoEventWireup="true" CodeFile="report.aspx.cs" Inherits="report" Title="Báo cáo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleHolder" Runat="Server">
    Báo cáo
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" Runat="Server">
<script type="text/javascript">
    $(document).ready(function() {
    $("#tableOne").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
        .tablesorterPager({ container: $("#pagerOne"), positionFixed: false })
        .tablesorterFilter({ filterContainer: $("#filterBoxOne"),
            filterClearContainer: $("#filterClearOne"),
            filterColumns: [0, 1, 2, 3, 4],
            filterCaseSensitive: false
        });	  
            
        //Tu ngay - den ngay
        initJQueryWidgets();
	}); 
	
	function initJQueryWidgets() {
         $("[ID$=txtFrom]").datepicker({
             changeMonth: true,
             changeYear: true
         });
         $("[ID$=txtTo]").datepicker({
             changeMonth: true,
             changeYear: true
         });
     }
 </script>
    <div align="center">
    <asp:Label ID="lblMsg" runat="server" Text="" ForeColor="#FF3300"></asp:Label></div>
<table width="700" border="0" cellpadding="3" cellspacing="1" class="margin_b15 margin_l150">
        <tr id="DateGroup" runat="server">
            <td align="left" valign="top" width="50">
                Báo cáo</td>
            <td align="left" valign="top">
                <asp:DropDownList ID="ddlReport" runat="server" AutoPostBack="True">
                    <asp:ListItem Value=""></asp:ListItem>
                    <asp:ListItem Value="01">Doanh thu bán thẻ theo ngày</asp:ListItem>
                    <asp:ListItem Value="02">Doanh thu bãi xe theo ngày</asp:ListItem>
                    <asp:ListItem Value="03">Doanh thu theo hóa đơn</asp:ListItem>
                    <%--<asp:ListItem Value="04">Doanh thu vé tháng theo khách hàng</asp:ListItem>--%>
                    
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="errorCode0" runat="server" ControlToValidate="ddlReport"
                    CssClass="errorMsg" ForeColor="#FF0000" SetFocusOnError="True" 
                    Display="Dynamic">Chọn 
                loại báo cáo</asp:RequiredFieldValidator>
            </td>
        </tr>
       
        <tr >
            <td align="left" valign="top" >
                Từ ngày
            </td>
            <td align="left" valign="top">
                <table border="0" cellpadding="0" cellspacing="0" width="490">
                    <tr>
                        <td align="left" valign="top" width="106">
                            <asp:TextBox ID="txtFrom" runat="server" CssClass="width_80" MaxLength="10"></asp:TextBox>
                        </td>
                        <td align="right" width="60">
                            Đến ngày&nbsp;
                        </td>
                        <td width="90" align="left">
                            <asp:TextBox ID="txtTo" runat="server" CssClass="width_80" MaxLength="10"></asp:TextBox>
                        </td>
                        <td align="left"> 
                          <div id="errorDate" style="display:none" class="errorMsg2">Chọn từ ngày đến ngày!</div>
                                                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                &nbsp;
            </td>
            <td align="left" valign="top">
                <asp:ImageButton ID="btnSearch" OnClientClick="return CheckDate()" runat="server" ImageUrl="~/images/search.gif" OnClick="btnSearch_Click" />    
                <asp:ImageButton ID="btnReset" runat="server" ImageUrl="~/images/xoa.gif" OnClick="btnReset_Click" />
            </td>
        </tr>
    </table>
    <table width="612" border="0" cellpadding="0" cellspacing="0" class="margin_b5 margin_l20">
        <tr>
            <td class="titleInfo">
                Xem trước báo cáo
            </td>
        </tr>
    </table>
    <div align="center" class="margin_b10 margin_t10">
        <em><asp:Label ID="msgResult" runat="server" Text=""></asp:Label></em></div>
     <asp:Repeater ID="rptSaleCardByDate" runat="server" EnableViewState="false" >
        <HeaderTemplate>
            <table id="tableOne" class="yui margin_l30 margin_b5" width="300" border="0" align="center"
                cellpadding="5" cellspacing="1">
                <thead>
                    <tr>
                        <th width="20">STT</th>
                        <th align="left" class="tableheader">Ngày</th>
                        <th  width="150" align="center" class="tableheader">Tổng số (VNĐ)</th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td align="center">
                    <asp:Label ID="lblNo" runat="server" Text="<%# Container.ItemIndex + 1 %>"></asp:Label>
                </td>
                <td align="left" valign="top"><%#Eval("OrderDate")%>
                </td>
                 <td align="right" valign="top"><asp:Label ID="lblTotalPrice" runat="server" Text='<%#Eval("TotalPrice")%>'></asp:Label>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody>
            <tfoot>
                <tr id="pagerOne">
                    <td colspan="3" class="tableFooter padding_t5">
                        <img title="Trang đầu" alt="Trang đầu" src="images/first.png" class="first" />
                        <img src="images/prev.png" class="prev" title="Trang trước" alt="Trang trước" />
                        <input type="text" class="pagedisplay" />
                        <img src="images/next.png" class="next" title="Trang kế" alt="Trang kế" />
                        <img src="images/last.png" class="last" title="Trang sau cùng" alt="Trang sau cùng" />&nbsp;&nbsp;
                        <select class="pagesize">
                            <option selected="selected" value="10">10</option>
                            <option value="30">30</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                    </td>
                </tr>
            </tfoot>
            </table>
        </FooterTemplate>
    </asp:Repeater>    
        
    <asp:Repeater ID="rptSaleByInvoice" runat="server" EnableViewState="false" 
        onitemdatabound="rptSaleByInvoice_ItemDataBound">
        <HeaderTemplate>
            <table id="tableOne" class="yui margin_l30 margin_b5" width="900" border="0" align="center"
                cellpadding="5" cellspacing="1">
                <thead>
                    <tr>
                        <th width="20">STT</th>
                        <th align="left" class="tableheader">Khách hàng</th>
                        <th  width="90" align="center" class="tableheader">Số hóa đơn</th>
                        <th width="90" align="center" class="tableheader">Ngày xuất</th>
                        <th width="90" align="center" class="tableheader">Số lượng thẻ</th>
                        <th width="90" align="center" class="tableheader">Tổng số (VNĐ)</th>
                        <th width="90" align="center" class="tableheader">Chiết khấu</th>
                        <th width="90" align="center" class="tableheader">Thực tế (VNĐ)</th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td align="center">
                    <asp:Label ID="lblNo" runat="server" Text="<%# Container.ItemIndex + 1 %>"></asp:Label>
                </td>
                <td align="left" valign="top"><%#Eval("CustomerName")%>
                </td>
                 <td align="center" valign="top"><asp:Label ID="lblOrderNo" runat="server" Text='<%#Eval("OrderNo")%>'></asp:Label>
                </td>
                 <td align="center" valign="top"><asp:Label ID="lblOrderDate" runat="server" Text='<%#Eval("OrderDate")%>'></asp:Label>
                 </td>
                  <td align="right" valign="top"><asp:Label ID="lblQuantity" runat="server" Text='<%#Eval("QuantityOfCard")%>'></asp:Label>
                 </td>
                  <td align="right" valign="top"><asp:Label ID="lblTotalPrice" runat="server" Text='<%#Eval("TotalPrice")%>'></asp:Label>
                 </td>
                  <td align="right" valign="top"><asp:Label ID="lblDiscount" runat="server" Text='<%#Eval("Discount")%>'></asp:Label>
                 </td>
                  <td align="right" valign="top"><asp:Label ID="lblPrac" runat="server" Text=''></asp:Label>
                 </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody>
            <tfoot>
                <tr id="pagerOne">
                    <td colspan="8" class="tableFooter padding_t5">
                        <img title="Trang đầu" alt="Trang đầu" src="images/first.png" class="first" />
                        <img src="images/prev.png" class="prev" title="Trang trước" alt="Trang trước" />
                        <input type="text" class="pagedisplay" />
                        <img src="images/next.png" class="next" title="Trang kế" alt="Trang kế" />
                        <img src="images/last.png" class="last" title="Trang sau cùng" alt="Trang sau cùng" />&nbsp;&nbsp;
                        <select class="pagesize">
                            <option selected="selected" value="10">10</option>
                            <option value="30">30</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                    </td>
                </tr>
            </tfoot>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    
     <asp:Repeater ID="rptSaveParkingByDate" runat="server" EnableViewState="false" 
        onitemdatabound="rptSaveParkingByDate_ItemDataBound">
        <HeaderTemplate>
            <table id="tableOne" class="yui margin_l30 margin_b5" width="600" border="0" align="center"
                cellpadding="5" cellspacing="1">
                <thead>
                    <tr>
                        <th width="20">STT</th>
                        <th align="center" class="tableheader">Ngày</th>
                        <th  width="120" align="center" class="tableheader">Vé tháng(VNĐ)</th>
                        <th width="120" align="center" class="tableheader">Vé thường(VNĐ)</th>
                        <th width="120" align="center" class="tableheader">Tổng số(VNĐ)</th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td align="center">
                    <asp:Label ID="lblNo" runat="server" Text="<%# Container.ItemIndex + 1 %>"></asp:Label>
                </td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%>
                </td>
                 <td align="right" valign="top"><asp:Label ID="lblMonthPrice" runat="server" Text='<%#Eval("MonthPrice")%>'></asp:Label>
                </td>
                 <td align="right" valign="top"><asp:Label ID="lblNormalPrice" runat="server" Text='<%#Eval("NormalPrice")%>'></asp:Label>
                 </td>
                  <td align="right" valign="top"><asp:Label ID="lblTotal" runat="server"></asp:Label>
                 </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody>
            <tfoot>
                <tr id="pagerOne">
                    <td colspan="5" class="tableFooter padding_t5">
                        <img title="Trang đầu" alt="Trang đầu" src="images/first.png" class="first" />
                        <img src="images/prev.png" class="prev" title="Trang trước" alt="Trang trước" />
                        <input type="text" class="pagedisplay" />
                        <img src="images/next.png" class="next" title="Trang kế" alt="Trang kế" />
                        <img src="images/last.png" class="last" title="Trang sau cùng" alt="Trang sau cùng" />&nbsp;&nbsp;
                        <select class="pagesize">
                            <option selected="selected" value="10">10</option>
                            <option value="30">30</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                    </td>
                </tr>
            </tfoot>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    
    <asp:Repeater ID="rptMonthCardByCustomer" runat="server" EnableViewState="false" 
        onitemdatabound="rptMonthCardByCustomer_ItemDataBound">
        <HeaderTemplate>
            <table id="tableOne" class="yui margin_l30 margin_b5" width="800" border="0" align="center"
                cellpadding="5" cellspacing="1">
                <thead>
                    <tr>
                        <th width="20">STT</th>
                        <th align="center" width="90" class="tableheader">Ngày</th>
                        <th align="left" class="tableheader">Khách hàng</th>
                        <th  width="90" align="center" class="tableheader">Ngày mua</th>
                        <th width="90" align="center" class="tableheader">Số lần mua</th>
                        <th width="90" align="center" class="tableheader">Total(VNĐ)</th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td align="center">
                    <asp:Label ID="lblNo" runat="server" Text="<%# Container.ItemIndex + 1 %>"></asp:Label>
                </td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%>
                </td>
                <td align="left" valign="top"><%#Eval("FullName")%>
                </td>
                 <td align="center" valign="top"><asp:Label ID="lblBuyDate" runat="server" Text='<%#Eval("BuyDate")%>'></asp:Label>
                </td>
                 <td align="center" valign="top"><asp:Label ID="lblNoOfTime" runat="server" Text='<%#Eval("NoOfTime")%>'></asp:Label>
                 </td>
                  <td align="right" valign="top"><asp:Label ID="lblTotal" runat="server" Text='<%#Eval("Total")%>'></asp:Label>
                 </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody>
            <tfoot>
                <tr id="pagerOne">
                    <td colspan="6" class="tableFooter padding_t5">
                        <img title="Trang đầu" alt="Trang đầu" src="images/first.png" class="first" />
                        <img src="images/prev.png" class="prev" title="Trang trước" alt="Trang trước" />
                        <input type="text" class="pagedisplay" />
                        <img src="images/next.png" class="next" title="Trang kế" alt="Trang kế" />
                        <img src="images/last.png" class="last" title="Trang sau cùng" alt="Trang sau cùng" />&nbsp;&nbsp;
                        <select class="pagesize">
                            <option selected="selected" value="10">10</option>
                            <option value="30">30</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                    </td>
                </tr>
            </tfoot>
            </table>
        </FooterTemplate>
    </asp:Repeater>

    <%--05 New===========================================================================================--%>

    <asp:Repeater ID="rptMotobike" runat="server" EnableViewState="false" 
        onitemdatabound="rptMonthCardByCustomer_ItemDataBound">
        <HeaderTemplate>
            <table id="tableOne" class="yui margin_l30 margin_b5" width="800" border="0" align="center"
                cellpadding="5" cellspacing="1">
                <thead>
                    <tr>
                        <th width="20">STT</th>
                        <th align="center" width="90" class="tableheader">Họ và tên</th>
                        <th align="left" class="tableheader">Hộ/Lô/Cty</th>
                        <th  width="90" align="center" class="tableheader">Số xe</th>
                        <th width="90" align="center" class="tableheader">Chưa thanh toán</th>
                        <th width="90" align="center" class="tableheader">Miễn phí</th>
                        <th width="90" align="center" class="tableheader">Màu xe</th>
                        <th width="90" align="center" class="tableheader">Từ Tháng</th>
                        <th width="90" align="center" class="tableheader">Đến Tháng</th>
                        <th width="90" align="center" class="tableheader">Xe số thường</th>
                        <th width="90" align="center" class="tableheader">Xe tay ga</th>
                        <th width="90" align="center" class="tableheader">Công ty</th>
                        <th width="90" align="center" class="tableheader">Khách</th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td align="left" colspan="13"><b><%#Eval("Ham")%></b></td>
            </tr>
            <tr>
                <td align="center"><%# Container.ItemIndex + 1 %></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody>
            <tfoot>
                <tr id="pagerOne">
                    <td colspan="13" class="tableFooter padding_t5">
                        <img title="Trang đầu" alt="Trang đầu" src="images/first.png" class="first" />
                        <img src="images/prev.png" class="prev" title="Trang trước" alt="Trang trước" />
                        <input type="text" class="pagedisplay" />
                        <img src="images/next.png" class="next" title="Trang kế" alt="Trang kế" />
                        <img src="images/last.png" class="last" title="Trang sau cùng" alt="Trang sau cùng" />&nbsp;&nbsp;
                        <select class="pagesize">
                            <option selected="selected" value="10">10</option>
                            <option value="30">30</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                    </td>
                </tr>
            </tfoot>
            </table>
        </FooterTemplate>
    </asp:Repeater>

    <%--06 New===========================================================================================--%>
    <asp:Repeater ID="rptMotobikeByFloor" runat="server" EnableViewState="false" 
        onitemdatabound="rptMonthCardByCustomer_ItemDataBound">
        <HeaderTemplate>
            <table id="tableOne" class="yui margin_l30 margin_b5" width="800" border="0" align="center"
                cellpadding="5" cellspacing="1">
                <thead>
                    <tr>
                        <th width="20">STT</th>
                        <th align="center" width="90" class="tableheader">Họ và tên</th>
                        <th align="left" class="tableheader">Hộ/Lô/Cty</th>
                        <th  width="90" align="center" class="tableheader">Số xe</th>
                        <th width="90" align="center" class="tableheader">Chưa thanh toán</th>
                        <th width="90" align="center" class="tableheader">Miễn phí</th>
                        <th width="90" align="center" class="tableheader">Màu xe</th>
                        <th width="90" align="center" class="tableheader">Từ Tháng</th>
                        <th width="90" align="center" class="tableheader">Đến Tháng</th>
                        <th width="90" align="center" class="tableheader">Xe số thường</th>
                        <th width="90" align="center" class="tableheader">Xe tay ga</th>
                        <th width="90" align="center" class="tableheader">Công ty</th>
                        <th width="90" align="center" class="tableheader">Khách</th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td align="left" colspan="13"><b><%#Eval("Ham")%></b></td>
            </tr>
            <tr>
                <td align="center"><%# Container.ItemIndex + 1 %></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
                <td align="center" valign="top"><%#Eval("CurrentDate")%></td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody>
            <tfoot>
                <tr id="pagerOne">
                    <td colspan="13" class="tableFooter padding_t5">
                        <img title="Trang đầu" alt="Trang đầu" src="images/first.png" class="first" />
                        <img src="images/prev.png" class="prev" title="Trang trước" alt="Trang trước" />
                        <input type="text" class="pagedisplay" />
                        <img src="images/next.png" class="next" title="Trang kế" alt="Trang kế" />
                        <img src="images/last.png" class="last" title="Trang sau cùng" alt="Trang sau cùng" />&nbsp;&nbsp;
                        <select class="pagesize">
                            <option selected="selected" value="10">10</option>
                            <option value="30">30</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                    </td>
                </tr>
            </tfoot>
            </table>
        </FooterTemplate>
    </asp:Repeater>

    
    <table width="100%"><tr><td align="center"><asp:ImageButton ID="btnExport"  
            runat="server" ImageUrl="~/images/export.jpg" onclick="btnExport_Click"/></td></tr></table>
</asp:Content>

